class Solution(object):
    def isMajorityElement(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: bool
        """
        i = 0
        n = len(nums)
        while i < len(nums):
            if nums[i] == target:
                break
            else:
                i += 1
        count = (n + 2) // 2
        if i + count - 1 >= n:
            return False
        if nums[i + count - 1] == target:
            return True
        else:
            return False
